package edu.xmut.factory.simplefactory.order;

import edu.xmut.factory.simplefactory.pizza.CheesePizza;
import edu.xmut.factory.simplefactory.pizza.GreekPizza;
import edu.xmut.factory.simplefactory.pizza.Pizza;

/**
 * @author 朔风
 * @date 2024-02-17 13:09
 */
public class SimpleFactory {
    public  Pizza createPizza(String orderType) {
        Pizza pizza = null;
        System.out.println("使用简单工厂模式");
        if ("greek".equals(orderType)) {
            pizza = new GreekPizza(orderType);
        } else if ("cheese".equals(orderType)) {
            pizza = new CheesePizza(orderType);
        }
        return pizza;
    }
}
